import request from '@/utils/request'
import ConstTable from './ConstTable'


const api = {
    // 获取日程安排
    getInfo(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/${id}`,
            method: 'get'
        });
    },
    // 获取日程安排列表
    getList(query)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar`,
            method: 'GET',
            data: query
        });
    },
    // 新建日程安排
    create(dataForm)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar`,
            method: 'post',
            data: dataForm,
        });
    },
    // 更新日程安排
    update(dataForm)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/${dataForm.id}`,
            method: 'put',
            data: dataForm,
        });
    },
    // 删除日程安排
    delete(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/${id}`,
            method: 'delete',
        });
    },
    // 初始化年度
    inityear(year)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/${year}`,
            method: 'post',
        });
    },
    // 获取日程安排子表数据
    getScheduleList(query)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/Schedule/getScheduleList`,
            method: 'GET',
            data: query
        });
    },

    // 获取日程安排子表信息
    ScheduleInfo(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/Schedule/ScheduleInfo/${id}`,
            method: 'get'
        })
    },
    // 新建日程子表安排
    ScheduleCreate(data)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/Schedule/ScheduleCreate`,
            method: 'post',
            data
        })
    },
    // 更新日程子表安排
    ScheduleUpdate(data)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/Schedule/ScheduleUpdate/${data.id}`,
            method: 'PUT',
            data
        })
    },
    // 删除日程子表安排
    ScheduleDelete(id)
    {
        return request({
            url: `${ConstTable.BaseUrl}/BaseData/Calendar/Schedule/ScheduleDelete/${id}`,
            method: 'DELETE',
        })
    }



};
export default api;
export const getScheduleAll = api.getAll;